import request from '@/utils/request';

export function getUserList() {
  console.log(request.getUri());
  
  return request.get('/user');
}
export function getOneByid(id:number){
  return request.get(`/user/${id}`)
}
export function createUser(data: { username: string; password: string ;sex:number}) {
  return request.post('/user', data);
}

export function updateUser(id: number, data: { username?: string; password?: string ;sex?:number}) {
  return request.put(`/user/${id}`, data);
}

export function deleteUser(id: number) {
  return request.delete(`/user/${id}`);
}